<template>
    <div class="ai">
        <div class="contain">
            <div class="header">
                <div class="text">智慧农业物联网管理平台</div>
                <div class="tip">Intelligent agriculture Internet of Things management platform</div>
            </div>
            <div class="contents">
                <div class="left">
                    <div class="module">
                        <div class="title">
                            <div class="shu"></div>
                            <div class="text">气象信息</div>
                        </div>
                        <div class="content own">
                            <div class="item" v-for="(v, k) in state.leftTopData" :key="k">
                                <div class="icon">
                                    <img :src="v.icon" alt="">
                                </div>
                                <div class="name">{{ v.name }}</div>
                                <div class="num">{{ v.num }}</div>
                            </div>
                        </div>
                    </div>
                    <div class="module">
                        <div class="title">
                            <div class="shu"></div>
                            <div class="text">园区基本信息</div>
                        </div>
                        <div class="content">
                            <div class="item2" v-for="(v, k) in state.leftCenter" :key="k">
                                <div class="icon">
                                    <img :src="v.icon" alt="">
                                </div>
                                <div class="item2-text">
                                    <div class="item2-text-top">
                                        <div class="item2-text-top-num">{{ v.num }}</div>
                                        <div class="item2-text-top-unit">{{ v.unit }}</div>
                                    </div>
                                    <div class="item2-text-bottom">{{ v.name }}</div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="module module300">
                        <div class="title">
                            <div class="shu"></div>
                            <div class="text">园区水肥</div>
                        </div>
                        <div class="content">
                            <div class="module-left"> <echarts-box :option="state.leftBottomLeft"></echarts-box></div>
                            <div class="module-right"> <echarts-box :option="state.leftBottomLeft"></echarts-box></div>
                        </div>
                    </div>
                </div>
                <div class="center">
                    <div class="module1">
                        <!-- <div class="back"></div> -->
                        <img src="@/images/ai/center.png" alt="">
                    </div>
                    <div class="module2">
                        <div class="title">
                            <div class="text">设备状态</div>
                        </div>
                        <div class="content">
                            <div class="item" v-for="(v, k) in state.centerData" :key="k">
                                <div class="icon">
                                    <img :src="v.icon" alt="">
                                </div>
                                <div class="name">{{ v.name }}</div>
                                <div class="num">{{ v.num }}</div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="right">
                    <div class="module">
                        <div class="title">
                            <div class="shu"></div>
                            <div class="text">视频监控</div>
                        </div>
                        <div class="content">
                            <div class="right-top">
                                <img src="@/images/ai/right.png" alt="">
                            </div>
                        </div>
                    </div>
                    <div class="module">
                        <div class="title">
                            <div class="shu"></div>
                            <div class="text">灌溉数据</div>
                        </div>
                        <div class="content content2">
                            <div class="right-center" v-for="(v,k) in state.rightCenterData" :key="k">
                                <div class="label">{{ v.label }}</div>
                                <div class="tip">:</div>
                                <div class="value">{{ v.value }}</div>
                            </div>
                        </div>
                    </div>
                    <div class="module">
                        <div class="title">
                            <div class="shu"></div>
                            <div class="text">种植总产量</div>
                        </div>
                        <div class="content">
                            <echarts-box :option="state.rightBottomData"></echarts-box>
                        </div>
                    </div>
                </div>
            </div>
            <div class="foot">
                <img src="@/images/ai/foot.png" alt="">
            </div>
        </div>
    </div>
</template>
<script setup>
import 'echarts-liquidfill'
import echartsBox from "@/components/echarts-box.vue";
import { reactive } from 'vue-demi'
import { leftTopData, leftCenter, leftBottomLeft, centerData,rightCenterData ,rightBottomData} from './data'
const state = reactive({
    leftTopData,
    leftCenter,
    leftBottomLeft,
    centerData,
    rightCenterData,
    rightBottomData
})
</script>
<style lang="scss" scoped>
.own{
    align-content: flex-start;

}
.ai {
    width: 100vw;
    height: 100vh;
    background: url(@/images/ai/bg.png) no-repeat;
    background-size: 100% 100%;
    overflow: hidden;
    color: #fff;
    font-weight: 600;
    .contain {
        height: 100%;
        display: flex;
        flex-direction: column;
        padding: 20px;
        justify-content: space-between;
        .header {
            background: url(@/images/ai/header.png) no-repeat;
            background-size: 100% 100%;
            height: 86px;
            text-align: center;
            margin-bottom: 20px;;
            .text {
                font-weight: bolder;
                background-image: linear-gradient(#e2f0fe, #2b92b8);
                -webkit-background-clip: text;
                color: transparent;
                height: 40px;
                font-size: 26px;
                display: flex;
                justify-content: center;
                align-items: center;
                padding-top: 10px;
            }

            .tip {
                margin-top: 0px;
                font-size: 12px;
            }
        }

        .contents {
            flex: 1;
            display: flex;

            .left,
            .right {
                background: url(@/images/ai/box.png) no-repeat;
                background-size: 100% 100%;
                display: flex;
                flex-direction: column;
                height: 100%;
                width: 400px;
            }

            .center {
                flex: 1;
                margin: 0 20px;
                display: flex;
                flex-direction: column;

                .module1,
                .module2 {
                    background: url(@/images/ai/box.png) no-repeat;
                    background-size: 100% 100%;
                }

                .module1 {
                    flex: 3;
                    margin-bottom: 20px;
                    padding: 1px;

                    img {
                        box-shadow: inset 2px 4px 8px #074761, inset -2px -4px 8px #074761;
                        width: 100%;
                        object-fit: cover;
                        height: 100%;
                    }
                }

                .module2 {
                    flex: 1;
                    display: flex;
                    flex-direction: column;

                    .title {
                        width: 50%;
                        margin: 0 auto;
                        background: url(@/images/ai/title.png) no-repeat;
                        background-size: 100% 100%;
                        text-align: center;
                        font-weight: bolder;

                        .text {
                            background-image: linear-gradient(#e2f0fe, #2b92b8);
                            -webkit-background-clip: text;
                            color: transparent;
                            // height: 50px;
                            font-size: 20px;
                            display: flex;
                            justify-content: center;
                            align-items: center;
                            margin-top: 10px;
                        }
                    }

                    .content {
                        flex: 1;
                        display: flex;

                        // margin-top: 40px;
                        .item {
                            flex: 1;
                            text-align: center;

                            .icon {
                                img {
                                    width: 8vw;
                                    object-fit: contain;
                                }
                            }

                            .name {
                                font-size: 14px;
                                color: #e2f0fe;
                                // margin-top: -20px;
                                position: relative;
                                top: -10px;
                            }

                            .num {
                                font-size: 20px;
                                font-weight: 600;
                                color: #41ebfa;
                            }
                        }
                    }
                }
            }

            .left,
            .right {
                .module {
                    flex: 1;
                    padding: 5px;
                    display: flex;
                    flex-direction: column;

                    .title {
                        display: flex;
                        height: 50px;

                        .shu {
                            width: 4px;
                            background: #0060FF;
                            margin-right: 4px;
                        }

                        .text {
                            flex: 1;
                            font-size: 14px;
                            padding-left: 20px;
                            background-image: linear-gradient(to right, rgba(0, 96, 255, 0.5), transparent 50%);
                            // background: red;
                            display: flex;
                            align-items: center;
                        }
                    }

                    .content {
                        flex: 1;
                        display: flex;
                        flex-wrap: wrap;
                        margin-top: 20px;
                        .item {
                            margin-bottom: 5px;
                            margin-left:20px;
                            padding: 4px 8px;
                            height: 50px;
                            width: 42%;
                            box-shadow: inset 2px 4px 8px #074761, inset -2px -4px 8px #074761;
                            display: flex;
                            align-items: center;
                            font-size: 14px;

                            .icon {
                                width: 16px;
                                margin-right: 10px;

                                img {
                                    width: 16px;
                                    height: 16px;
                                    vertical-align: middle;
                                }
                            }

                            .name {
                                flex: 2;
                            }

                            .num {
                                margin-left: 10px;
                                flex: 1
                            }

                            &:nth-child(2n-1) {
                                margin-right: 10px;
                            }
                        }

                        .item2 {
                            display: flex;
                            width: 44%;
                            align-items: center;
                            margin-bottom: 10px;
                            margin-left:20px;
                            .icon {
                                margin-right: 10px;

                                img {
                                    width: 50px;
                                    object-fit: contain;
                                }
                            }

                            .item2-text {
                                .item2-text-top {
                                    display: flex;
                                    font-size: 24px;
                                    color: #41ebfa;
                                    font-weight: 600;

                                    .item2-text-top-num {
                                        margin-right: 10px;
                                    }
                                }

                                .item2-text-bottom {
                                    font-size: 12px;
                                    margin-top: 10px;
                                }
                            }
                        }

                        .module-left,
                        .module-right {
                            flex: 1;
                        }

                        .module-left {
                            margin-right: 10px;
                        }
                        .right-top{
                            img{
                                width:100%;
                                object-fit: contain;
                            }
                        }
                        .right-center{
                            margin-bottom: 10px;
                            display: flex;
                            font-size: 14px;;
                            text-align: center;
                            .label{
                                width:40%;
                            }
                            .value{
                                flex:1;
                                color: #44F0FF;
                            }
                        }
                    }
                    .content2{
                        display: block;
                    }
                }
            }
        }

        .foot {
            margin-top: 20px;;
            img {
                width: 100%;
                object-fit: contain;
            }
        }
    }

}
</style>